/*
 * Misc.h
 *
 *  Created on: 17 déc. 2011
 *      Author: M. Alexandre (malexand314@gmail.com)
 */

#ifndef MISC_H_
#define MISC_H_

#include <iostream>
#include <sstream>
#include <vector>
#include <cstdio>
#include <cstdlib>
#include <pthread.h>

/*
 *
 */
namespace Framework
{

    class Misc
    {
        public:
            Misc();
            virtual ~Misc();

        public:
            static std::string getLine();
            static int getInteger();
            static std::string getStringForIntTable(const int* _aiTable, const int _iSize);
            static std::string getStringForIntTable(const std::vector<int>& _vecTable);
            static void printIntTable(const int* _aiTable, const int _iSize);
            static void printIntTable(const std::vector<int>& _vecTable);
            static int randomInt(const int _iMin, const int _iMax);
            static int linearIntSearch(const int* _aiTable, const int _iSize, const int _iToFind);
            static int linearIntSearch(const std::vector<int>& _vecInt, const int _iToFind);
            static int linearReverseIntSearch(const int* _aiTable, const int _iSize, const int _iToFind);
            static int linearReverseIntSearch(const std::vector<int>& _vecInt, const int _iToFind);
            static int binaryIntSearch(const int* _aiTable, int _iSize, const int _iToFind);
            static int binaryIntSearch(const std::vector<int>& _vecInt, const int _iToFind);

        private:
            static bool m_bIsFirstRandom;
    };

}

#endif /* MISC_H_ */
